import httpRequest from "./base";
interface LianluDataDto {
  id?: number;
  lianlu_code: string;
  lianlu_name: string;
  lianlu_start: string;
  lianlu_end: string;
  lianlu_status: number;
}
// 获取全部链路信息
export function getAllLianluListApi(lianlu_code?: string) {
  return httpRequest({
    url: `/shanghai${lianlu_code ? "?lianlu_code=" + lianlu_code : ""}`,
    method: "get",
  });
}

// 新增链路
export function createLianluApi(data: LianluDataDto) {
  return httpRequest({
    url: "/shanghai",
    method: "post",
    data,
  });
}

// 删除链路
export function delLianluApi(id: string) {
  return httpRequest({
    url: `/shanghai/${id}`,
    method: "delete",
  });
}

// 更新链路
export function updataLianluApi(data: LianluDataDto) {
  return httpRequest({
    url: `/shanghai/${data.id}`,
    method: "put",
    data,
  });
}
